import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            int n=scanner.nextInt();
            List<String> list=new ArrayList<>();
            String[] str=new String[n];
            for(int i=0;i<n;i++){
                str[i]=scanner.nextLine();
            }
            Arrays.sort(str);
            for(int i=1;i<n;i++){
                if(!str[i].startsWith(str[i-1]+"/")){
                    list.add(str[i-1]);
                }
            }
            list.add(str[str.length-1]);
            for(String s:list){
                System.out.println("mkdir -p "+s);
            }
            System.out.println();
        }
    }














    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            int n=Integer.parseInt(scanner.nextLine());
            String[] str=new String[n];
            Stack<String> stack=new Stack<>();
            int max=0;
            for(int i=0;i<n;i++){
                str[i]=scanner.nextLine();
                if(!str[i].contains("disconnect")){
                    stack.push(str[i]);
                    max=Math.max(max,stack.size());
                }else{
                    stack.pop();
                }
            }
            System.out.println(max);
        }
    }
}
